#include "types.h"

double perfect_gaz(double rho, double T)
{
    //return (T*(rho-1.9*rho*rho+rho*rho*rho));
	return(T*(rho+rho*rho*rho));
}

double vdw_fluid(double rho,double T)
{
	//double rho_i=1.0;
    return(((8.0*T)/3.0)*(rho)/(1.0-(rho/3.0))-3.0*rho*rho);
	//return(T*(rho+rho_i));
}

double eta_1(double rho, double T)
{
	/*const double rho_a=0.1; 
	const double rho_b=1.0;
	const double delt = 0.1;
	const double rho_0 = 1.802;
	
	return(0.5*(rho_a+rho_b)+0.5*(rho_b-rho_a)*tanh((rho-0.5*rho_0)/delt)); */
	return(1.0);
}

double zeta_1(double rho, double T)
{
	/*const double rho_a=0.1; 
	const double rho_b=1.0;
	const double delt = 0.1; 
	const double rho_0 = 1.802;
	
	return(0.5*(rho_a+rho_b)+0.5*(rho_b-rho_a)*tanh((rho-0.5*rho_0)/delt)); */
	return(1.0);
}

#include <time.h>
void alea_init()
{
    srand( time(NULL) );
}

double alea()
{
    static const double fac = 1.0 / ( ((double)RAND_MAX) + 1.0);
    return (( (double)rand() ) + 0.5) * fac;
}

double max_of( double a, double b)
{
    return a < b ? b : a ;
}

double min_of( double a, double b)
{
    return a < b ? a : b;
}
